srvMap.add('queryUserByIdAndPwd', '','front/sh/login!execute?uid=queryUserByIdAndPwd');//登陆请求
// 绑定回车事件
$(document).keydown(function(e) {
	var keycode = e.keyCode;
	if (keycode == 13) {
		$(".botton_login").click();
	}
});

function login(obj) {
	var _o = $(obj);
	$("#loginTip").html("正在登录中，请稍等......");

	var userId = $("#userId").val();
	var userPassword = $("#userPassword").val();
	if (userId == "" || userPassword == "") {
		$("#loginTip").html("用户名/密码不能为空");
	}
	if (null == userId || null == userPassword || userId.length < 1
			|| userPassword.length < 1) {
		$("#loginTip").html("请输入用户名/密码").show();
		return;
	}
	
	var par = "&userId="+userId+"&userPassword="+userPassword;

	Util.ajax.postJsonSync(srvMap.get('queryUserByIdAndPwd'),par,function(json,status){
		if(status){
			var loginInfo = json.object;
			if (null != loginInfo) {
				var loginCode = loginInfo.loginCode;
				var loginDesc = loginInfo.loginDesc;
				if ("0" == loginCode) {
					window.location.href =  "../zhly/index.jsp";
					$("#loginTip").html("登陆成功").show();
				} else {
					$("#loginTip").html(loginDesc).show();
				}
			}

		}else{
			$("#loginTip").html("网络异常，请稍后再尝试登录").show();  
		}
	});

//	var data = {
//		"userId" : userId,
//		"userPassword" : userPassword
//	};

//	var url = CONTENT_PATH + "/login.do?num=" + new Date();
//	Base
//			.ajax({
//				url : url,
//				data : data,
//				success : function(req) {

//			});
}